home *** CD-ROM | disk | FTP | other *** search
XSetup plugin | 2001-04-13 | 3.6 KB | 153 lines |
- "FILE"="Xteq Systems X-Setup Plugin 6.0"
- "TYPE"="8"
- "COUNT"="3"
- "UIPATH 1"="Startup/Shutdown\Startup\Windows 9x/ME\50) AutoRun - Part 1"
- "UIPATH 2"="Startup/Shutdown\Startup\Windows NT/2K/XP\20) AutoRun - Part 1"
- "NAME"="AutoRun Services"
- "VERSION"="2.03"
- "LANGUAGE"="VBScript"
- "TEXT 1"="Show Info"
- "TEXT 2"="Enable/Disable"
- "TEXT 3"="Delete"
- "DESCRIPTION 1"="These services (system programs) are automatically started when this computer is started."
- "DESCRIPTION 2"="Click "Show Info" to see the command that is executed, "Enable/Disable" to enable or disable an item or "Delete" to remove an item."
- "AUTHOR"="Xteq Systems"
- "CONTACTURL"="http://www.xteq.com"
- "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
- "COMMENT 1"=" "
-
-
- '/*** MAIN TEMPLATE IS XQ AutoRun Lister.XPL ***/
- '/*** ONLY CHANGE REGISTRY KEYS BELOW ***/
-
- sP="HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices\"
- sPD1="HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices-\"
- sPD2="HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices (Disabled)\"
-
- '/////////////////////////////////
- '///*** NO CHANGES BELOW HERE ***/
- Dim aryLoc()
- Dim iReadAllCount
-
- sDisabled=" [DISABLED]"
-
- Sub Plugin_Initialize
- iReadAllCount=0
- Call ReloadAll
- End Sub
-
- Sub ReloadAll
- for i=1 to iReadAllCount
- Call SetUIElement(i,"")
- next
-
- i=0
-
- iC=RegEnumValues(sP)
- i=i+iC
-
- iC=RegEnumValues(sPD1)
- i=i+iC
-
- iC=RegEnumValues(sPD2)
- i=i+iC
-
-
- ReDim aryLoc(i)
- iReadAllCount=1
-
- Call ReadAll(sP,1,false)
- Call ReadAll(sPD1,2,true)
- Call ReadAll(sPD2,3,true)
- End Sub
-
- Sub ReadAll(key,idx,IsDisabledKey)
- iC=RegEnumValues(key)
- if iC>0 then
- for l=1 to iC
- sName=RegEnumElement(l)
-
- If IsDisabledKey=true then
- sName=sName & sDisabled
- end if
-
- Call SetUIElement(iReadAllCount,sName)
- aryLoc(iReadAllCount)=idx
-
- iReadAllCount=iReadAllCount+1
- Next
- end if
-
- End Sub
-
-
-
- Sub Plugin_CheckData(ElementIndex)
- End Sub
-
- Sub Plugin_Apply(ElementIndex,ElementSubIndex)
- if ElementSubIndex>0 then
-
- 'Look up Registry key
- if aryLoc(ElementSubIndex)=1 then
- sRegPath=sP
- elseif aryLoc(ElementSubIndex)=2 then
- sRegPath=sPD1
- else
- sRegPath=sPD2
- end if
-
- 'Look up Registry name
- sRegName=GetUIElement(ElementSubIndex)
- bIsEnabled=true
- If InStr(sRegName,sDisabled)>0 then
- sRegName=Left(sRegName,len(sRegName)-len(sDisabled))
- bIsEnabled=false
- end if
-
- 'Look up Value
- sValue=RegReadValue(sRegPath & sRegName)
-
- 'msginformation sRegPath
- 'msginformation sRegName & "]"
- 'msginformation sValue
-
-
- if ElementIndex=1 then '//Information
- Call MsgInformation("Command: " & vbCrlF & vbCrlf & sValue)
- end if
-
- If ElementIndex=2 then '//Enable/Disable
- if bIsEnabled=true then
- '//Disable it
- Call RegWriteValue(sPD1 & sRegName,sValue,1)
- Call RegDeleteValue(sRegPath & sRegName)
- else
- '//Enable it
- Call RegWriteValue(sP & sRegName,sValue,1)
- Call RegDeleteValue(sRegPath & sRegName)
- end if
-
- Call ReloadAll
- end if
-
-
- If ElementIndex=3 then 'Delete
- If bIsEnabled=true then
- Call MsgError("Unable to delete an enabled item - please disable it first before trying to delete it")
- else
- Call RegDeleteValue(sRegPath & sRegName)
- Call ReloadAll
- Call Restart
- end if
- end if
-
- end if
- End Sub
-
- Sub Plugin_Terminate
- End Sub
-
-
-
-